# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test
# Description:   例5.11
# Author:       ASUS
# Date:         2019/3/3
#-------------------------------------------------------------------------------


dirs = '','usr','local','nginx',''
linuxpath = '/'.join(dirs)
print(linuxpath)                           #/usr/local/nginx/
windowpath = 'C:'+'\\'.join(dirs)
print(windowpath)                          #C:\usr\local\nginx\
s="+"
numlist = [1,2,3,4,5]
print(s.join(numlist))                     #与字符串连接的序列元素必须是字符串类型，否则会报错
